This site gives a small sample of how to create significant digits, which are good for programs involving money.

 
import java.text.*;
 
class sample
{
public static void main(String Args[])
{
 
 
DecimalFormat numberTest = new DecimalFormat("####0.00");
 
double deee = .0099999;
 
System.out.println(deee);
System.out.println(numberTest.format(deee));
}
 
the first one were to print .0099999
but the second one would print .01